package com.shark.app.persistent.entity;

import java.sql.Timestamp;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Version;

/**
 * Created by lenovo on 2016/8/17.
 */
@Entity
@Table(name = "t_wm_finance_sys_menu", schema = "", catalog = "weimob_payment")
public class TWmFinanceSysMenuEntity {
    private int id;
    private String menuName;
    private String href;
    private int parentId;
    private String target;
    private String icon;
    private int isShow;
    private int sort;
    private String permission;
    private Timestamp createTime;
    private Timestamp updateTime;
    private int version;
    private int flag;

    @Id
    @Column(name = "id", nullable = false, insertable = true, updatable = true)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "menu_name", nullable = false, insertable = true, updatable = true, length = 50)
    public String getMenuName() {
        return menuName;
    }

    public void setMenuName(String menuName) {
        this.menuName = menuName;
    }

    @Basic
    @Column(name = "href", nullable = true, insertable = true, updatable = true, length = 200)
    public String getHref() {
        return href;
    }

    public void setHref(String href) {
        this.href = href;
    }

    @Basic
    @Column(name = "parent_id", nullable = false, insertable = true, updatable = true)
    public int getParentId() {
        return parentId;
    }

    public void setParentId(int parentId) {
        this.parentId = parentId;
    }

    @Basic
    @Column(name = "target", nullable = true, insertable = true, updatable = true, length = 20)
    public String getTarget() {
        return target;
    }

    public void setTarget(String target) {
        this.target = target;
    }

    @Basic
    @Column(name = "icon", nullable = true, insertable = true, updatable = true, length = 30)
    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    @Basic
    @Column(name = "is_show", nullable = false, insertable = true, updatable = true)
    public int getIsShow() {
        return isShow;
    }

    public void setIsShow(int isShow) {
        this.isShow = isShow;
    }

    @Basic
    @Column(name = "sort", nullable = false, insertable = true, updatable = true)
    public int getSort() {
        return sort;
    }

    public void setSort(int sort) {
        this.sort = sort;
    }

    @Basic
    @Column(name = "permission", nullable = true, insertable = true, updatable = true, length = 100)
    public String getPermission() {
        return permission;
    }

    public void setPermission(String permission) {
        this.permission = permission;
    }

    @Basic
    @Column(name = "create_time", nullable = false, insertable = true, updatable = true)
    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "update_time", nullable = false, insertable = true, updatable = true)
    public Timestamp getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Timestamp updateTime) {
        this.updateTime = updateTime;
    }

    @Version
    @Column(name = "version", nullable = false, insertable = true, updatable = true)
    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

    @Basic
    @Column(name = "flag", nullable = false, insertable = true, updatable = true)
    public int getFlag() {
        return flag;
    }

    public void setFlag(int flag) {
        this.flag = flag;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TWmFinanceSysMenuEntity that = (TWmFinanceSysMenuEntity) o;

        if (id != that.id) return false;
        if (parentId != that.parentId) return false;
        if (isShow != that.isShow) return false;
        if (sort != that.sort) return false;
        if (version != that.version) return false;
        if (flag != that.flag) return false;
        if (menuName != null ? !menuName.equals(that.menuName) : that.menuName != null) return false;
        if (href != null ? !href.equals(that.href) : that.href != null) return false;
        if (target != null ? !target.equals(that.target) : that.target != null) return false;
        if (icon != null ? !icon.equals(that.icon) : that.icon != null) return false;
        if (permission != null ? !permission.equals(that.permission) : that.permission != null) return false;
        if (createTime != null ? !createTime.equals(that.createTime) : that.createTime != null) return false;
        if (updateTime != null ? !updateTime.equals(that.updateTime) : that.updateTime != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (menuName != null ? menuName.hashCode() : 0);
        result = 31 * result + (href != null ? href.hashCode() : 0);
        result = 31 * result + parentId;
        result = 31 * result + (target != null ? target.hashCode() : 0);
        result = 31 * result + (icon != null ? icon.hashCode() : 0);
        result = 31 * result + isShow;
        result = 31 * result + sort;
        result = 31 * result + (permission != null ? permission.hashCode() : 0);
        result = 31 * result + (createTime != null ? createTime.hashCode() : 0);
        result = 31 * result + (updateTime != null ? updateTime.hashCode() : 0);
        result = 31 * result + version;
        result = 31 * result + flag;
        return result;
    }
}
